home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-M68K / SETUP.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  8KB  |  285 lines

  1. /*
  2. ** asm/setup.h -- Definition of the Linux/m68k setup information
  3. **
  4. ** Copyright 1992 by Greg Harp
  5. **
  6. ** This file is subject to the terms and conditions of the GNU General Public
  7. ** License.  See the file COPYING in the main directory of this archive
  8. ** for more details.
  9. **
  10. ** Created 09/29/92 by Greg Harp
  11. **
  12. ** 5/2/94 Roman Hodek:
  13. **   Added bi_atari part of the machine dependent union bi_un; for now it
  14. **   contains just a model field to distinguish between TT and Falcon.
  15. ** 26/7/96 Roman Zippel:
  16. **   Renamed to setup.h; added some useful macros to allow gcc some
  17. **   optimizations if possible.
  18. ** 5/10/96 Geert Uytterhoeven:
  19. **   Redesign of the boot information structure; moved boot information
  20. **   structure to bootinfo.h
  21. */
  22.  
  23. #ifndef _M68K_SETUP_H
  24. #define _M68K_SETUP_H
  25.  
  26. #include <linux/config.h>
  27.  
  28.  
  29.     /*
  30.      *  Linux/m68k Architectures
  31.      */
  32.  
  33. #define MACH_AMIGA    1
  34. #define MACH_ATARI    2
  35. #define MACH_MAC      3
  36. #define MACH_APOLLO   4
  37. #define MACH_SUN3     5
  38. #define MACH_MVME147  6
  39. #define MACH_MVME16x  7
  40. #define MACH_BVME6000 8
  41. #define MACH_HP300    9
  42.  
  43. #ifdef __KERNEL__
  44.  
  45. #ifndef __ASSEMBLY__
  46. extern unsigned long m68k_machtype;
  47. #endif /* !__ASSEMBLY__ */
  48.  
  49. #if !defined(CONFIG_AMIGA)
  50. #  define MACH_IS_AMIGA (0)
  51. #elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
  52.     || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) || defined(CONFIG_HP300)
  53. #  define MACH_IS_AMIGA (m68k_machtype == MACH_AMIGA)
  54. #else
  55. #  define MACH_AMIGA_ONLY
  56. #  define MACH_IS_AMIGA (1)
  57. #  define MACH_TYPE (MACH_AMIGA)
  58. #endif
  59.  
  60. #if !defined(CONFIG_ATARI)
  61. #  define MACH_IS_ATARI (0)
  62. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
  63.     || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) || defined(CONFIG_HP300)
  64. #  define MACH_IS_ATARI (m68k_machtype == MACH_ATARI)
  65. #else
  66. #  define MACH_ATARI_ONLY
  67. #  define MACH_IS_ATARI (1)
  68. #  define MACH_TYPE (MACH_ATARI)
  69. #endif
  70.  
  71. #if !defined(CONFIG_MAC)
  72. #  define MACH_IS_MAC (0)
  73. #elif defined(CONFIG_AMIGA) || defined(CONFIG_ATARI) || defined(CONFIG_APOLLO) \
  74.     || defined(CONFIG_HP300) || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000)
  75. #  define MACH_IS_MAC (m68k_machtype == MACH_MAC)
  76. #else
  77. #  define MACH_MAC_ONLY
  78. #  define MACH_IS_MAC (1)
  79. #  define MACH_TYPE (MACH_MAC)
  80. #endif
  81.  
  82. #if defined(CONFIG_SUN3)
  83. #  error Currently no Sun-3 support!
  84. #else
  85. #define MACH_IS_SUN3 (0)
  86. #endif
  87.  
  88. #if !defined (CONFIG_APOLLO)
  89. #  define MACH_IS_APOLLO (0)
  90. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
  91.     || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) || defined(CONFIG_HP300)
  92. #  define MACH_IS_APOLLO (m68k_machtype == MACH_APOLLO)
  93. #else
  94. #  define MACH_APOLLO_ONLY
  95. #  define MACH_IS_APOLLO (1)
  96. #  define MACH_TYPE (MACH_APOLLO)
  97. #endif
  98.  
  99. #if !defined (CONFIG_MVME16x)
  100. #  define MACH_IS_MVME16x (0)
  101. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
  102.     || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000) || defined(CONFIG_HP300)
  103. #  define MACH_IS_MVME16x (m68k_machtype == MACH_MVME16x)
  104. #else
  105. #  define MACH_MVME16x_ONLY
  106. #  define MACH_IS_MVME16x (1)
  107. #  define MACH_TYPE (MACH_MVME16x)
  108. #endif
  109.  
  110. #if !defined (CONFIG_BVME6000)
  111. #  define MACH_IS_BVME6000 (0)
  112. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
  113.     || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) || defined(CONFIG_HP300)
  114. #  define MACH_IS_BVME6000 (m68k_machtype == MACH_BVME6000)
  115. #else
  116. #  define MACH_BVME6000_ONLY
  117. #  define MACH_IS_BVME6000 (1)
  118. #  define MACH_TYPE (MACH_BVME6000)
  119. #endif
  120.  
  121. #if !defined (CONFIG_HP300)
  122. #  define MACH_IS_HP300 (0)
  123. #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
  124.     || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000)
  125. #  define MAC_IS_HP300 (m68k_machtype == MACH_HP300)
  126. #else
  127. #  define MACH_HP300_ONLY
  128. #  define MACH_IS_HP300 (1)
  129. #  define MACH_TYPE (MACH_HP300)
  130. #endif
  131.  
  132. #ifndef MACH_TYPE
  133. #  define MACH_TYPE (m68k_machtype)
  134. #endif
  135.  
  136. #endif /* __KERNEL__ */
  137.  
  138.  
  139.     /*
  140.      *  CPU, FPU and MMU types
  141.      *
  142.      *  Note: we may rely on the following equalities:
  143.      *
  144.      *      CPU_68020 == MMU_68851
  145.      *      CPU_68030 == MMU_68030
  146.      *      CPU_68040 == FPU_68040 == MMU_68040
  147.      *      CPU_68060 == FPU_68060 == MMU_68060
  148.      */
  149.  
  150. #define CPUB_68020     0
  151. #define CPUB_68030     1
  152. #define CPUB_68040     2
  153. #define CPUB_68060     3
  154.  
  155. #define CPU_68020      (1<<CPUB_68020)
  156. #define CPU_68030      (1<<CPUB_68030)
  157. #define CPU_68040      (1<<CPUB_68040)
  158. #define CPU_68060      (1<<CPUB_68060)
  159.  
  160. #define FPUB_68881     0
  161. #define FPUB_68882     1
  162. #define FPUB_68040     2                       /* Internal FPU */
  163. #define FPUB_68060     3                       /* Internal FPU */
  164. #define FPUB_SUNFPA    4                       /* Sun-3 FPA */
  165.  
  166. #define FPU_68881      (1<<FPUB_68881)
  167. #define FPU_68882      (1<<FPUB_68882)
  168. #define FPU_68040      (1<<FPUB_68040)
  169. #define FPU_68060      (1<<FPUB_68060)
  170. #define FPU_SUNFPA     (1<<FPUB_SUNFPA)
  171.  
  172. #define MMUB_68851     0
  173. #define MMUB_68030     1                       /* Internal MMU */
  174. #define MMUB_68040     2                       /* Internal MMU */
  175. #define MMUB_68060     3                       /* Internal MMU */
  176. #define MMUB_APOLLO    4                       /* Custom Apollo */
  177. #define MMUB_SUN3      5                       /* Custom Sun-3 */
  178.  
  179. #define MMU_68851      (1<<MMUB_68851)
  180. #define MMU_68030      (1<<MMUB_68030)
  181. #define MMU_68040      (1<<MMUB_68040)
  182. #define MMU_68060      (1<<MMUB_68060)
  183. #define MMU_SUN3       (1<<MMUB_SUN3)
  184. #define MMU_APOLLO     (1<<MMUB_APOLLO)
  185.  
  186. #ifdef __KERNEL__
  187.  
  188. #ifndef __ASSEMBLY__
  189. extern unsigned long m68k_cputype;
  190. extern unsigned long m68k_fputype;
  191. extern unsigned long m68k_mmutype;            /* Not really used yet */
  192.  
  193.     /*
  194.      *  m68k_is040or060 is != 0 for a '040 or higher;
  195.      *  used numbers are 4 for 68040 and 6 for 68060.
  196.      */
  197.  
  198. extern int m68k_is040or060;
  199. #endif /* !__ASSEMBLY__ */
  200.  
  201. #if !defined(CONFIG_M68020)
  202. #  define CPU_IS_020 (0)
  203. #elif defined(CONFIG_M68030) || defined(CONFIG_M68040) || defined(CONFIG_M68060)
  204. #  define CPU_IS_020 (m68k_cputype & CPU_68020)
  205. #else
  206. #  define CPU_M68020_ONLY
  207. #  define CPU_IS_020 (1)
  208. #endif
  209.  
  210. #if !defined(CONFIG_M68030)
  211. #  define CPU_IS_030 (0)
  212. #elif defined(CONFIG_M68020) || defined(CONFIG_M68040) || defined(CONFIG_M68060)
  213. #  define CPU_IS_030 (m68k_cputype & CPU_68030)
  214. #else
  215. #  define CPU_M68030_ONLY
  216. #  define CPU_IS_030 (1)
  217. #endif
  218.  
  219. #if !defined(CONFIG_M68040)
  220. #  define CPU_IS_040 (0)
  221. #elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68060)
  222. #  define CPU_IS_040 (m68k_cputype & CPU_68040)
  223. #else
  224. #  define CPU_M68040_ONLY
  225. #  define CPU_IS_040 (1)
  226. #endif
  227.  
  228. #if !defined(CONFIG_M68060)
  229. #  define CPU_IS_060 (0)
  230. #elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68040)
  231. #  define CPU_IS_060 (m68k_cputype & CPU_68060)
  232. #else
  233. #  define CPU_M68060_ONLY
  234. #  define CPU_IS_060 (1)
  235. #endif
  236.  
  237. #if !defined(CONFIG_M68020) && !defined(CONFIG_M68030)
  238. #  define CPU_IS_020_OR_030 (0)
  239. #else
  240. #  define CPU_M68020_OR_M68030
  241. #  if defined(CONFIG_M68040) || defined(CONFIG_M68060)
  242. #    define CPU_IS_020_OR_030 (!m68k_is040or060)
  243. #  else
  244. #    define CPU_M68020_OR_M68030_ONLY
  245. #    define CPU_IS_020_OR_030 (1)
  246. #  endif
  247. #endif
  248.  
  249. #if !defined(CONFIG_M68040) && !defined(CONFIG_M68060)
  250. #  define CPU_IS_040_OR_060 (0)
  251. #else
  252. #  define CPU_M68040_OR_M68060
  253. #  if defined(CONFIG_M68020) || defined(CONFIG_M68030)
  254. #    define CPU_IS_040_OR_060 (m68k_is040or060)
  255. #  else
  256. #    define CPU_M68040_OR_M68060_ONLY
  257. #    define CPU_IS_040_OR_060 (1)
  258. #  endif
  259. #endif
  260.  
  261. #define CPU_TYPE (m68k_cputype)
  262.  
  263.  
  264.     /*
  265.      *  Miscellaneous
  266.      */
  267.  
  268. #define NUM_MEMINFO    4
  269. #define CL_SIZE        256
  270.  
  271. #ifndef __ASSEMBLY__
  272. extern int m68k_num_memory;        /* # of memory blocks found (and used) */
  273. extern int m68k_realnum_memory;        /* real # of memory blocks found */
  274. extern struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */
  275.  
  276. struct mem_info {
  277.     unsigned long addr;        /* physical address of memory chunk */
  278.     unsigned long size;        /* length of memory chunk (in bytes) */
  279. };
  280. #endif
  281.  
  282. #endif /* __KERNEL__ */
  283.  
  284. #endif /* _M68K_SETUP_H */
  285.